/*
 * @Author: 卡卡 1071780426@qq.com
 * @Date: 2023-12-18 10:02:37
 * @LastEditors: 卡卡 1071780426@qq.com
 * @LastEditTime: 2024-03-11 13:40:15
 * @FilePath: \newMould_BHZ\src\components\commonPublic\processVideo\index.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */



export default {
    props: [
        "dialogVisible",
        "currentRow"
    ],
    data() {
        return {
            visible: "",
            videoSrc: null,
            loading: true,
            title: null,
            dialogHeight: null,
            types: null,
        };
    },
    components: {},
    watch: {
        dialogVisible: {
            handler(newVal) {
                if (newVal) {
                    this.visible = newVal;
                }
            },
            immediate: true,
        },
        currentRow: {
            handler(newVal) {
                if (newVal) {
                    var that = this
                    that.videoSrc = newVal.fVideo;
                    this.loading = false
                }
            },
            immediate: true,
        },
    },
    created() {
        window.addEventListener("resize", this.getHeight);
        this.getHeight();
    }, //获取页面高度自适应：

    destroyed() {
        window.removeEventListener("resize", this.getHeight);
        this.getHeight();
    },
    mounted() {
        window.addEventListener('resize', function() {
            var iframe = document.getElementsByTagName('iframe')[0];
            iframe.style.width = window.innerWidth + 'px';
            iframe.style.height = window.innerHeight + 'px';
          });

        this.getHeight();
    },
    methods: {
        getHeight() {
            var h = document.documentElement.clientHeight; //获取页面可见高度
            this.dialogHeight = h * 0.76 + "px";
        },
        closeDialog() {
            this.$emit("close");
        },
    },
};